return 0;
}
-#define GPFN_TO_GPTEPAGE(_gpfn) ((_gpfn) / (PAGE_SIZE / sizeof(guest_l1_pgentry_t)))
-static inline unsigned long
-predict_writable_pte_page(struct domain *d, unsigned long gpfn)
-{
- return __shadow_status(d, GPFN_TO_GPTEPAGE(gpfn), PGT_writable_pred);
-}
-
-static inline void
-increase_writable_pte_prediction(struct domain *d, unsigned long gpfn, unsigned long prediction)
-{
- unsigned long score = prediction & PGT_score_mask;
- int create = (score == 0);
-
- // saturating addition
- score = (score + (1u << PGT_score_shift)) & PGT_score_mask;
- score = score ? score : PGT_score_mask;
-
- prediction = (prediction & PGT_mfn_mask) | score;
-
- //printk("increase gpfn=%lx pred=%lx create=%d\n", gpfn, prediction, create);
- set_shadow_status(d, GPFN_TO_GPTEPAGE(gpfn), 0, prediction, PGT_writable_pred, 0);
-
- if ( create )
- perfc_incr(writable_pte_predictions);
-}
-
-static inline void
-decrease_writable_pte_prediction(struct domain *d, unsigned long gpfn, unsigned long prediction)
-{
- unsigned long score = prediction & PGT_score_mask;
- ASSERT(score);
-
- // divide score by 2... We don't like bad predictions.
- //
- score = (score >> 1) & PGT_score_mask;
-
- prediction = (prediction & PGT_mfn_mask) | score;
-
- //printk("decrease gpfn=%lx pred=%lx score=%lx\n", gpfn, prediction, score);
-
- if ( score )
- set_shadow_status(d, GPFN_TO_GPTEPAGE(gpfn), 0, prediction, PGT_writable_pred, 0);
- else
- {
- delete_shadow_status(d, GPFN_TO_GPTEPAGE(gpfn), 0, PGT_writable_pred, 0);
- perfc_decr(writable_pte_predictions);
- }
-}
-
static int fix_entry(
struct domain *d,
l1_pgentry_t *pt, u32 *found, int is_l1_shadow, u32 max_refs_to_find)
#ifdef __x86_64__
#define PGT_high_mfn_shift 52
#define PGT_high_mfn_mask (0xfffUL << PGT_high_mfn_shift)
-#define PGT_mfn_mask (((1U<<23)-1) | PGT_high_mfn_mask)
+#define PGT_mfn_mask (((1U<<27)-1) | PGT_high_mfn_mask)
#define PGT_high_mfn_nx (0x800UL << PGT_high_mfn_shift)
#else
/* 23-bit mfn mask for shadow types: good for up to 32GB RAM. */
#define PGT_mfn_mask ((1U<<23)-1)
/* NX for PAE xen is not supported yet */
#define PGT_high_mfn_nx (1ULL << 63)
-#endif
#define PGT_score_shift 23
#define PGT_score_mask (((1U<<4)-1)<<PGT_score_shift)
+#endif
/* Cleared when the owning guest 'frees' this page. */
#define _PGC_allocated 31